package com.kgcx.order.controller;
import com.kgcx.common.bean.RequestData;
import com.kgcx.common.bean.ReturnData;
import com.kgcx.common.controller.BaseController;
import com.kgcx.order.domain.PayAccount;
import com.kgcx.order.service.PayAccountService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@Api(description = "公司支付信息", tags = "公司支付信息接口")
@RestController
@RequestMapping("payAccount")
public class PayAccountController extends BaseController {
	@Autowired
	private PayAccountService payAccountService;

	@ApiOperation(value = "新增公司支付信息", httpMethod = "POST", notes = "公司支付信息接口")
	@PostMapping("addPayAccountInfo")
	public ReturnData<?> addPayAccountInfo(@RequestBody PayAccount payAccount) {
		payAccountService.insertPayAccount(payAccount);
		return new ReturnData<>();
	}
	@ApiOperation(value = "查询公司支付信息", httpMethod = "GET", notes = "这是用来查询公司支付信息的接口")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "kid", value = "主键ID", required = false, paramType = "query", dataType = "String", dataTypeClass = String.class)
    })
	/**
     * 专给监管平台提供查询
     */
    @GetMapping("getPayAccountInfo")
    public ReturnData<PayAccount> getBaseInfo() {
        RequestData requestData = this.getRequestData();
        PayAccount payAccount =payAccountService.getPayAccount(requestData.getLong("kid"));
        return new ReturnData<>(payAccount);
    }
}
